import React, {Component} from 'react'
import {browserHistory} from 'react-router'
import {Table, Icon} from 'antd'

const columns = [
    {
        title: '图标',
        dataIndex: 'icon',
        key: 'icon',
        render: text => <img style={{width:'40px', height:'40px', borderRadius:8}}></img>,
    }, {
        title: '名称',
        dataIndex: 'name',
        key: 'name',
        render: text => <a href="#">{text}</a>,
    }, {
        title: '类型',
        dataIndex: 'os',
        key: 'os',
    }, {
        title: '版本号',
        dataIndex: 'version',
        key: 'version',
    }, {
        title: '更新时间',
        dataIndex: 'updateAt',
        key: 'updateAt',
    }, {
        title: '操作',
        key: 'action',
        render: (text, record) => (
            <span>
      <a href="#">发布新版本</a>
      <span className="ant-divider"/>
      <a href="#">删除</a>
      <span className="ant-divider"/>
      <a href="#" className="ant-dropdown-link">
        更多 <Icon type="down"/>
      </a>
    </span>
        ),
    }];

class Apps extends Component {
    constructor(props) {
        super(props);
        this.state = {}

        this.viewData = {
            dataArray: [
                {
                    name: '健康寿光',
                    os:'ios',
                    version: '1.0.0',
                    updateAt: '2017-08-03 17:00',
                }, {
                    name: '健康寿光',
                    os:'ios',
                    version: '1.0.0',
                    updateAt: '2017-08-03 17:00',
                }, {
                    name: '健康寿光',
                    os:'ios',
                    version: '1.0.0',
                    updateAt: '2017-08-03 17:00',
                }, {
                    name: '健康寿光',
                    os:'ios',
                    version: '1.0.0',
                    updateAt: '2017-08-03 17:00',
                }
            ],
        }
    }

    render() {
        let props
        return (
            <div>
                <Table columns={columns} dataSource={this.viewData.dataArray}/>
            </div>
        )
    }
}

export default Apps;
